package com.bobi.ecofavor.model.dto;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;

/**
 * @author wenyuan
 * @version 1.0
 * @date 2023/10/24
 * @since 8
 */
@Data
public class OrderDto implements Serializable {

    private static final long serialVersionUID = 1L;

    private Integer id;

    @ApiModelProperty(value = "订单编号")
    private String orderSn;

    @ApiModelProperty(value = "参数列表")
    private String goodsParam;

    @ApiModelProperty(value = "商品数量")
    private BigDecimal goodsNum;

    @ApiModelProperty(value = "用户名字")
    private String userName;

    @ApiModelProperty(value = "用户联系方式")
    private String userPhone;

    @ApiModelProperty(value = "店铺名称")
    private String storeName;

    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @ApiModelProperty(value = "订购时间")
    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    private LocalDateTime orderTime;

    @ApiModelProperty(value = "是否预定")
    private Boolean isReserved;

    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "预定时间")
    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    private LocalDateTime scheduledTime;


    @ApiModelProperty(value = "可使用的优惠券")
    private List<CouponDto> useableCoupons;

    @ApiModelProperty(value = "选择使用的优惠券")
    private List<String> selectedCoupons;

    @ApiModelProperty(value = "订单状态（已取消、待支付、已支付、未完成、已完成）")
    private Integer orderStatus;

    @ApiModelProperty(value = "订单状态（已取消、待支付、已支付、未完成、已完成）")
    private String statusMean;


    @ApiModelProperty(value = "商品名称")
    private String goodsName;

    @ApiModelProperty(value = "商品图片")
    private String goodsImage;

    @ApiModelProperty(value = "商品类型")
    private String goodsCategory;


    @ApiModelProperty(value = "总计金额")
    private BigDecimal totalMoney;

    @ApiModelProperty(value = "优惠金额")
    private BigDecimal discountMoney;

    @ApiModelProperty(value = "结算金额")
    private BigDecimal settlementMoney;

    @ApiModelProperty(value = "支付方式")
    private Integer paymentMod;

    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @ApiModelProperty(value = "支付时间")
    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    private LocalDateTime payTime;
}
